let http=require('http');
let _=require('lodash');
let [host,port]=['localhost',9999];

http.createServer((req,resp)=>{

    resp.writeHead(200,{
        'Content-Type':'text/plain'
    });
    resp.end('Hello Node.js\n');
}).listen(port);
host=_.isInteger(port)?'localhost:9999':'';
console.log(`server run at ${host}`);